package com.androidx.p013lv.base.model;

import androidx.lifecycle.MutableLiveData;
import androidx.lifecycle.ViewModel;
import com.androidx.p013lv.base.bean.OfficialListBean;
import com.androidx.p013lv.base.http.BaseRes;
import com.androidx.p013lv.base.http.HttpUtils;
import com.androidx.p013lv.base.http.UrlManager;
import com.androidx.p013lv.base.http.callback.HttpCallback;
import com.androidx.p013lv.base.utils.SpUtils;

/* renamed from: com.androidx.lv.base.model.SquareModel */
public class SquareModel extends ViewModel {
    private MutableLiveData<BaseRes<OfficialListBean>> attention;
    private MutableLiveData<BaseRes<OfficialListBean>> data;

    public MutableLiveData<BaseRes<OfficialListBean>> data() {
        if (this.data == null) {
            this.data = new MutableLiveData<>();
        }
        return this.data;
    }

    public MutableLiveData<BaseRes<OfficialListBean>> getAttention() {
        if (this.attention == null) {
            this.attention = new MutableLiveData<>();
        }
        return this.attention;
    }

    public void getInfo(String str, int i) {
        HttpUtils.getInsatance().get(UrlManager.getInsatance().squareList(str, i, 30), new HttpCallback<BaseRes<OfficialListBean>>("squareList") {
            /* class com.androidx.p013lv.base.model.SquareModel.C10291 */

            public void onLvSuccess(BaseRes<OfficialListBean> baseRes) {
                SquareModel.this.data.setValue(baseRes);
            }
        });
    }

    public void getAttention(int i) {
        HttpUtils.getInsatance().get(UrlManager.getInsatance().fanList(SpUtils.getInstance().getUserInfo().getUserId(), i), new HttpCallback<BaseRes<OfficialListBean>>("fanList") {
            /* class com.androidx.p013lv.base.model.SquareModel.C10302 */

            public void onLvSuccess(BaseRes<OfficialListBean> baseRes) {
                SquareModel.this.attention.setValue(baseRes);
            }
        });
    }

    public void cancelHttp() {
        HttpUtils.getInsatance().cancelTag("squareList");
        HttpUtils.getInsatance().cancelTag("fanList");
    }
}
